package smartcounters.androidclient.model;

import org.ksoap2.serialization.SoapObject;

public class Bill {
    private int m_Year;
    private int m_Month;
    private int m_AccountID;
    private double m_TotalUsage;
    private double m_SumPaid;
    
    public int getYear(){
    	return m_Year;
    }
    
    public void setYear(int i_Year){
    	m_Year = i_Year;
    }
    
    public int getMonth(){
    	return m_Month;
    }
    
    public void setMonth(int i_Month){
    	m_Month = i_Month;
    }
    
    public int getAccountID(){
    	return m_AccountID;
    }
    
    public void setAccountID(int i_AccountID){
    	m_AccountID = i_AccountID;
    }
    
    public double getTotalUsage(){
    	return m_TotalUsage;
    }
    
    public void setTotalUsage(double i_TotalUsage){
    	m_TotalUsage = i_TotalUsage;
    }
    
    public double getSumPaid(){
    	return m_SumPaid;
    }
    
    public void setSumPaid(double i_SumPaid){
    	m_SumPaid = i_SumPaid;
    }
    
    public static Bill CreateFromSoapObject(SoapObject billObject){
    	Bill bill = new Bill();
    	
    	bill.setAccountID(Integer.parseInt(billObject.getProperty("AccountID").toString()));
    	bill.setYear(Integer.parseInt(billObject.getProperty("Year").toString()));
    	bill.setMonth(Integer.parseInt(billObject.getProperty("Month").toString()));
    	bill.setTotalUsage(Double.parseDouble(billObject.getProperty("TotalUsage").toString()));
    	bill.setSumPaid(Double.parseDouble(billObject.getProperty("SumPaid").toString()));
    	
    	return bill;
    }
}
